$().ready(function() {
		

$("#Neuigkeit .stream .date").each(function () {
		  	  value = $(this).attr("title");
		  	  time = value.split(' ');
		  	  var date = time[0].split('-');
		  	  stream = time[1].split(':');
		  	  
		  	  var now = new Date();
		  	  var nowH = now.getHours();
		  	  var nowM = now.getMinutes();
		  	  var nowS = now.getSeconds();
		  	  var nowD  = now.getDate();
		  	  var nowMo = now.getMonth()+1;

		  	  var h = stream[0];
		  	  var m = stream[1];
		  	  var s = stream[2];
			  var Mo = date[1];
			  var D = date[2];
		  	  
		  	  var diffh = nowH - h;
		  	  var diffm = nowM - m;
		  	  var diffs = nowS - s;
		  	  var diffMo= nowMo - Mo ;
		  	  var diffD = D - nowD;

		  	  if(diffMo != 0){
		   		$(this).html("am "+time[0]+" um "+time[1]+ "Uhr");
		   	  }
		  	  if(diffD > 0 && diffMo == 0){
		   		$(this).html(diffD+" Tagen um "+time[1]+ "Uhr");
		   	  }
		  	  if(diffh > 0 && diffD == 0 && diffMo == 0){
		  		$(this).html(diffh+" Stunden");
		  	  }
		  	  if(diffm > 0 && diffh == 0  && diffD == 0 && diffMo == 0){
		  		$(this).html(diffm+" Minuten");
		  	  }
		  	  if(diffs > 0 && diffh == 0 && diffm == 0  && diffD == 0 && diffMo == 0){
		  		$(this).html(diffs+" Sekunden");
		  	  }
		     	  
		    });
		
	    setInterval(function() {
	    	$("#Neuigkeit .stream .date").each(function () {
	    		 value = $(this).attr("title");
			  	  time = value.split(' ');
			  	  var date = time[0].split('-');
			  	  stream = time[1].split(':');

			  	  var now = new Date();
			  	  var nowH = now.getHours();
			  	  var nowM = now.getMinutes();
			  	  var nowS = now.getSeconds();
			  	  var nowD  = now.getDate();
			  	  var nowMo = now.getMonth()+1;

			  	  var h = stream[0];
			  	  var m = stream[1];
			  	  var s = stream[2];
				  var Mo = date[1];
				  var D = date[2];
			  	  
			  	  var diffh = nowH - h;
			  	  var diffm = nowM - m;
			  	  var diffs = nowS - s;
			  	  var diffMo= nowMo - Mo ;
			  	  var diffD = D - nowD;

			  	  if(diffMo != 0){
			   		$(this).html("am "+time[0]+" um "+time[1]+ "Uhr");
			   	  }
			  	  if(diffD > 0 && diffMo == 0){
			   		$(this).html(diffD+" Tagen um "+time[1]+ "Uhr");
			   	  }
			  	  if(diffh > 0 && diffD == 0 && diffMo == 0){
			  		$(this).html(diffh+" Stunden");
			  	  }
			  	  if(diffm > 0 && diffh == 0  && diffD == 0 && diffMo == 0){
			  		$(this).html(diffm+" Minuten");
			  	  }
			  	  if(diffs > 0 && diffh == 0 && diffm == 0  && diffD == 0 && diffMo == 0){
			  		$(this).html(diffs+" Sekunden");
			  	  }
			     	  
			    });
		}, 100000);
		
		/*$('a[rel*=bambase]').facebox({
          loadingImage : 'media/image/frontend/v4/loading.gif',
          closeImage   : 'media/image/frontend/v4/closelabel.png'
        });*/
	    
        $('#PageExplorer .pages').hover(function() {
				$(this).find(".aktion").show();
			}, function() {
				$(this).find(".aktion").hide();
			});
});